<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }

    html, body{
        width: 100%;
        height: 100%;
    }
    
    .container{
        width: 100%;
        height: 100%;
    }

    .light{
        background-color: white;
        color: black;
    }
    .dark{
        background-color: black;
        color: white;
    }

</style>
<body>
    <div style="font-size: 20px; font-weight: 700;">点我放大字体</div>
    <div class="continer light">
        这是一段话<br>
        这是一段话<br>
        这是一段话<br>
        这是一段话<br>
        这是一段话<br>
        这是一段话<br>
    </div>
</body>
<script>
    var div = document.querySelector('div');
    div.onclick = function(){
        var curFontSize = parseInt(this.style.fontSize);
        curFontSize += 10;
        this.style.fontSize = curFontSize + 'px';
    }

    var mode = document.querySelector('.continer');
    mode.onclick =  function(){
        console.log(mode.className);
        if(mode.className == 'light')
            mode.className = 'dark';
        else
            mode.className = 'light';
    }
    
</script>
</html>